package com.sgy.handwrite_mvc.demo.controller;

import com.sgy.handwrite_mvc.demo.service.DemoService;
import com.sgy.handwrite_mvc.mvcframework.annotations.SgyAutowired;
import com.sgy.handwrite_mvc.mvcframework.annotations.SgyController;
import com.sgy.handwrite_mvc.mvcframework.annotations.SgyRequestMapping;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@SgyController
@SgyRequestMapping("/demo")
public class DemoController {

    @SgyAutowired
    private DemoService demoService;

    @SgyRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return demoService.get(name);
    }
}
